package 强化训练;

import java.util.Arrays;
import java.util.Scanner;
//通过0
public class day37mkdir {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){
            int n = Integer.parseInt(sc.next());
            String[] dirs = new String[n];
            for (int i = 0; i < n; i++) {
                dirs[i] = sc.next();
            }

            Arrays.sort(dirs);

            boolean[] flags = new boolean[n];
            for (int i = 0; i < dirs.length - 1; i++) {
                if (dirs[i].equals(dirs[i+1])){
                    flags[i] = true;
                }else if (dirs[i].length() < dirs[i+1].length() && dirs[i+1].startsWith(dirs[i])
                        && dirs[i+1].charAt(dirs[i].length()) == '/'){
                    flags[i] = true;
                }
            }
            for (int i = 0; i < n; i++) {
                if (!flags[i]){
                    System.out.println("mkdir -p " + dirs[i]);
                }
            }
        }
    }

}
